package com.xdog.okx.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.xdog.okx.service.IOkxLogService;
import com.xdog.okx.utils.OkxApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * OKX日志数据服务实现类
 * 提供事件日志数据查询功能
 */
@Slf4j
@Service
public class OkxLogServiceImpl implements IOkxLogService {

    @Override
    public JSONObject getLogByBlockAndAddress(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/log/by-block-and-address";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getLogByAddressAndTopic(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/log/by-address-and-topic";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getLogByAddress(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/log/by-address";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getLogByTransaction(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/log/by-transaction";
        return OkxApiUtil.get(requestPath, params);
    }
}